<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/1/17
 * Time: 11:59
 */

namespace addons\seller\controller;


use app\common\Session;
use think\addons\Controller;

class Common extends Controller
{
    public static $base_config = [
        "ROOT_PATH" => ADDON_PATH,
        "DATA_PATH" => ADDON_PATH . "/admin/data/",
        "SELLER_PATH" => ADDON_PATH . "/seller/data/",
    ];

    /**
     * 是不是商家
     * @return bool
     */
    function is_seller()
    {
        $admin = Session::get_local_seller();
        return !empty($admin);
    }

    function check_login()
    {
        if ($this->is_seller()) {
        } else {
            $this->error("请登录", "/addons/execute/seller-User-login");
        }
    }
}